/*--------------------------------------------------------------------------------------*\
**
** seminary_window.h
**
** Heroes IV
** Copyright 2000, The 3DO Company
**
\*--------------------------------------------------------------------------------------*/

#ifndef SEMINARY_WINDOW_H_INCLUDED
#define SEMINARY_WINDOW_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "bitmap_group_ptr.h"
#include "button_group.h"
#include "game_window.h"
#include "text_window_ptr.h"
#include "toggle_button_ptr.h"
#include "town.h"
#include <vector>

class t_creature_array;
class t_creature_array_window;
class t_creature_select_window;
class t_text_window;

class t_seminary_window : public t_window
{
   
public:
	t_seminary_window( t_creature_array* army, t_creature_array* adjacent_army, 
					   t_stationary_adventure_object const& object, 
					   std::string const& title, t_skill_list const& skills, 
					   t_window* parent );

	enum
	{
		k_skill_button_count = 4
	};
                
protected:
	t_creature_array            m_adjacent_heroes;
	t_stationary_adventure_object const&	m_adventure_object;
	t_window*					m_background;
	t_bitmap_group_ptr          m_bitmaps_ptr;
	t_button *                  m_buy_button_ptr;
	t_text_window*              m_cost_window_ptr;
	int						    m_current_cost;
	t_skill						m_current_skills[k_skill_button_count];
	t_creature_array	        m_garrison_heroes;
	int						    m_player_funds;
	t_player *			        m_player_ptr;
	t_hero*						m_selected_hero;
	t_toggle_button_ptr			m_skill_buttons[k_skill_button_count];
	t_button_group			    m_skill_button_group;
	t_bitmap_group_ptr			m_skill_frames;
	int						    m_skill_selected;
	t_text_window_ptr			m_skill_text[k_skill_button_count];
    t_skill_list                m_skills;
	t_creature_array_window *   m_garrison_hero_window;
	t_text_window*				m_text;
	t_creature_array_window *   m_visiting_hero_window;
            
    void buy_clicked( t_button* button );
    void choose_skill( t_button* button, int id );
    void close_clicked( t_button* button );
	void create_background();
	void create_buttons();
	void create_rings();
	void create_skill_buttons();
    void create_skill_toggle_button( t_screen_rect skill_rect, t_skill skill, 
									 t_window* parent_window, int id);
	t_skill get_learnable_skill( t_hero& hero, t_skill skill );
	void	enable_learn( bool arg );
    void hero_selection_change( t_creature_array_window*, int selection );
	void select_skills( t_hero& hero );
    void set_text();
};

#endif // SEMINARY_WINDOW_H_INCLUDED
